package org.shj.jdbc;

import org.shj.utils.DbUtils;

import java.io.FileOutputStream;
import java.util.List;

/**
 * @author Shen Huang Jian
 * @date 2020-08-31 14:39
 */
public class RawJdbc {

    public static void main(String[] args){
        String sql = "select id, case_situatn from new_grid_mediate_invstgt";
        try(FileOutputStream os = new FileOutputStream("d:\\test\\situation.txt")) {
            List<CaseInfo> list = DbUtils.findBySql(sql, CaseInfo.class);
            for(CaseInfo caseInfo : list){
                os.write((caseInfo.getCaseSituatn()+"\n").getBytes());
            }
            os.flush();
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
